<template>
    <view class="main">
        <view class="icon" :style="{ 'background-color': obj.is_success ? '#55946d' : '#e75e57' }">
            <wd-icon :name="obj.is_success ? 'check' : 'close'" size="50px" color="#fff"></wd-icon>
        </view>
        <view class="over">{{ obj.is_success ? '支付成功' : '支付失败' }}</view>
        <view class="text" @click="back">
            <button class="search btn"
                :style="{ 'background-color': obj.is_success ? '#55946d' : '#e75e57' }">返回订单</button>
        </view>
    </view>
</template>

<script setup>
import { onLoad } from '@dcloudio/uni-app';
import { ref } from 'vue';
const back = () => {
    uni.reLaunch({ url: '/pages/mine/myOrder' })
}

let obj = ref({})
onLoad((op) => {
    obj.value = JSON.parse(op.result)
})
</script>

<style lang="scss" scoped>
.main {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    margin-top: 30px;

    .text {
        margin-top: 50px;
    }
}

.btn {
    padding: 10rpx 200rpx;
    font-size: 26rpx;
    border-radius: 7rpx;
}

.err {
    background-color: #e75e57;
}

.success {
    background-color: #55946d;
}

.icon {
    padding: 20rpx;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
}

.search {
    background-color: #55946d;
    color: #fff;
}

.over {
    font-weight: 900;
    font-size: 35rpx;
    margin-top: 20px;
}
</style>